use dta\Turnout_District_Level, clear 

gen zz=1

drop _merge
sort year SMD_district
merge year SMD_district using dta/NoP_pre.dta

foreach year in 1921 1924 1927 {
drop _merge
sort year PR_district
merge year PR_district using dta/NoP`year'.dta, update
}

keep if zz==1 /* 92 districts with data pre and post reform */

bysort year: egen mean_NoP=mean(NoP)
label var mean_NoP "Number of Parties Running"
label var NoP "Number of Parties Running"

***********************************************************************
************************TIME SERIES OF MEAN NOP************************
***********************************************************************

twoway (scatter mean_NoP year if year<1920, mstyle(p1) lstyle(p1) lpattern(dash) connect(l)) (scatter mean_NoP year if year>1920 & year<1930, mstyle(p1) lstyle(p1) lpattern(dash) connect(l)), ///
graphregion(fcolor(white)) scheme(s2mono) legend(off) ytitle("Average number of parties running") xtitle("") xscale(range(1909 1927)) xlabel(1909[3]1927) yscale(range(0 6)) ylabel(0[1]6)
graph export figures\FigureA4.tif, replace
graph export figures\FigureA4.eps, replace
